
/** $Id: MessageType.java 60 2009-06-15 08:47:09Z salbanese0080@gmail.com $ */

package org.aquiferserver.common;

/**
 * @author Seth Albanese
 *
 */
public class MessageType 
{	
	public static final MessageType MT_SERV = 				new MessageType( 0 );
	public static final MessageType MT_PEER = 				new MessageType( 1 );
	public static final MessageType MT_HANDSHAKE = 			new MessageType( 2 );
	public static final MessageType MT_HANDSHAKE_CONFIRM = 	new MessageType( 3 );
	public static final MessageType MT_ERROR = 				new MessageType( 4 );
	public static final MessageType MT_CONNECTED = 			new MessageType( 5 );
	public static final MessageType MT_PEER_CONNECT = 		new MessageType( 6 );
	public static final MessageType MT_PEER_DISCONNECT = 	new MessageType( 7 );
	
	public static final MessageType MT_COMPOSIT = 			new MessageType( 8 );
		
	public int type;
	
	public MessageType() {};
	public MessageType( int t )
	{
		this.type = t;
	}
	
	public void setType( int t )
	{
		type = t;
	}
	
	public int getType()
	{
		return type;
	}
	
	@Override
	public boolean equals( Object obj )
	{
		if( !( obj instanceof org.aquiferserver.common.MessageType ) )
		{
			return false;
		}
		
		MessageType other = ( MessageType ) obj;
		return ( other.getType() == this.getType() );
	}
}
